Ext.define('CA.dictionary.Module', {
    extend: 'Ext.ux.desktop.Module',

    uses: [
        'CA.dictionary.Window'
    ],

    id: 'module-dictionary',

    moduleInfo: {
        name: 'Справочники',
        iconCls: 'c-icon-book'
    },

    init : function(){
        this.launcher = {
            text: this.moduleInfo.name,
            iconCls: this.moduleInfo.iconCls,
            handler : this.createWindow,
            scope: this
        };
    },

    createWindow: function(){
        var desktop = this.app.getDesktop(),
            win = desktop.getWindow(this.id);

        if(!win){
            win = desktop.createWindow({
                id: this.id,
                title: this.moduleInfo.name,
                iconCls: this.moduleInfo.iconCls
            }, CA.dictionary.Window);
        }
        win.show();

        return win;
    }
});
